﻿using Shiloh.Job.Model.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Shiloh.Job.Model.Entities
{
    /// <summary>
    /// 操作日志
    /// </summary>
    public class ActionLog
    {
        public Guid? UserID { get; set; }
        public string? Username { get; set; }
        public ActionLogTypeEnum ActionType { get; set; }
        public DateTime ActionTime { get; set; } = DateTime.Now;
        public DeviceTypeEnum ActionDevice { get; set; }
        public object? ActionData { get; set; }
    }

    // 操作日志工厂类
    public class ActionLogFactory
    {
        public static ActionLog CreateLog(Guid? userId,string? username, ActionLogTypeEnum actionType, DeviceTypeEnum actionDevice, object? actionData = null)
        {
            return new ActionLog
            {
                UserID = userId,
                Username = username,
                ActionType = actionType,
                ActionDevice = actionDevice,
                ActionData = actionData
            };
        }
    }
}
